<%@ page contentType="text/html;charset=utf-8" language="java"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@include file="./common/base.jsp" %><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户中心_约导游</title>
<!--css-->
<link rel="stylesheet" type="text/css" href="css/wutongstyle.css">
<link rel="stylesheet" type="text/css" href="city/citySelector.css">
<script src="city/citySelector.js" type="text/javascript"></script>
<script src="js/page.js" type="text/javascript"></script>
</head>
<body>
<!--head begin-->
<%@ include  file="./common/header.jsp"%>
<!--nav end--> 
<!--content begin-->
<div class="wt_content">
  <dl class="yuedaoyou">
	<%@ include  file="./common/header2.jsp"%><dd>
    <dd>
      <div class="daoyou_info clearfix">
        <div class="xx_box">
          <div class="tainfobox yonghu">
            <h3 id="tuan"><i class="i_co"></i>已申请信息</h3>
            <div class="tainfo">
              <ul class="daituan2" id="lxsTuanId">
             
              </ul>
              <div class="n_page clearfix">
                <ul id="1_fenyeId">
                
                </ul>
              </div>
            </div>
          </div>
        </div>
        <div class="zp"><img id="headImgId" src="" width="185" height="90" />
          <div class="tel">
            <h4>快捷菜单</h4>
            <ul class="quick">
              <li><a href="lxslogin_1.jsp">发布新团信息</a></li>
              <li><a href="lxslogin.jsp">团信息列表</a></li>
              <li><a href="lxslogin_2.jsp" >新发团信息</a></li>
              <li><a href="lxslogin_3.jsp" class="on">已申请信息</a></li>
              <li><a href="lxslogin_4.jsp">已确认信息</a></li>
              <li><a href="lxslogin_6.jsp" >已发团信息</a></li>
              <li><a href="lxslogin_5.jsp">我的资料</a></li>
              <li><a href="lxslogin_7.jsp">站内短信列表</a></li>
            </ul>
          </div>
          <div class="yhsousuo">
            <h4>搜索团信息</h4>
            <input id="selCityId" class="cityinput"  placeholder="填写城市名称">
            <button type="button" value="搜索" onclick="selTeam();">搜索</button>
          </div>
        </div>
      </div>
    </dd>
  </dl>
</div>
<!--content end--> 
<!--footer begin-->
<%@ include  file="./common/footer.jsp"%>
<!--footer end-->
</body>
<script type="text/javascript">
var pageIndex=1;
var pageSize=3;
var pageCount = 0;
var recordCount = 0;
var selCity="";
$(function(){
	loadLxsTeamList(pageIndex,pageSize);
	$("#headImgId").attr("src",imgDomain+loginUserPhoto);
});
function selTeam() {
	selCity=$("#selCityId").val();
	pageIndex=1
	loadLxsTeamList(pageIndex,pageSize);
}
function loadLxsTeamList(ppageIndex,ppageSize) {
	var lxspageIndex =ppageIndex;
	var lxspageSize = ppageSize;
	var objp= "{\"pageIndex\":\""+(lxspageIndex-1)+"\","+
		         "\"pageSize\":\""+lxspageSize+"\","+
		         "\"city\":\""+selCity+"\","+
		         "\"apply\":"+2+""+
		         "}";
	   $.ajax({
			  url: '${path}/core/getTravelTeamList',
			  type: 'POST',
			  timeout: 30000,
			  cache : false,
		      data :objp,
		      async: false,
		      dataType:"json",      
	          contentType:"application/json",   
		     // contentType: "application/json; charset=utf-8",
			  success:function(msg){
				  //alert(msg.totalCount)
				  formatLxsTeamList(msg.dataList);
				  formatFenYe(msg.totalCount);
			  },
			   failure:function(msg){
				   alert(eval('('+msg.responseText+')').error_text);
			   		
			   },
			   error:function(msg){
				   alert(eval('('+msg.responseText+')').error_text); 
			   }
		});
}

function formatLxsTeamList(dataList) {
	var ulDiv =$("#lxsTuanId");
		ulDiv.empty();
		for(var k=0;k<dataList.length;k++) {
			var pingjiastr=formatLxsStatus(dataList[k].applycount,dataList[k].guidestatus,dataList[k].commentstatus,dataList[k].startTimeCompare,dataList[k].id);
			ulDiv.append( " <li>"+
							// "<div class=\"tupian\"><a href=\"lxinfo.html\"><img src=\"wutongimages/tuan3.jpg\"/></a></div>"+
			                  "<div class=\"xiangqing\"><a target=\"_blank\" href=\"lxinfo.jsp?teamId="+dataList[k].id+"\"> "+
			                  "<h2><span>出发地点："+dataList[k].sourcecity+" | 目的地："+dataList[k].targetcity+" | 出发时间："+dataList[k].startTime+"</span>"+dataList[k].teamtitle+"</h2> "+
							   "</a>"+
			                     "<pre style=\"word-wrap:break-word; word-break:break-all;\">"+dataList[k].trip+"</pre> "+
							   "<div class=\"bianji\">"+pingjiastr+"</div>"+
							 "</div>"+
							 "</li> ");
		}
}

function formatFenYe(totalCount){
	 recordCount = totalCount;
	 pageCount = Math.ceil(recordCount/pageSize);
	 pageRefresh(function () { 
		 loadLxsTeamList(pageIndex,pageSize);
	 });
}
new Vcity.CitySelector({input:'selCityId'});
</script>

</html>
